class ZhuojiNotifyActiveMsg{
    constructor(){
        this.uid = 0;
        this.operation = 0;
        this.timer = 0;
        this.leftNum = 0;
        this.tingList = [];
        this.gangList = [];
        this.card = 0;
        this.tingResults = [];
        this.grabCard = 0;

    }

    toJSON(){
        let msg = {
            uid : this.uid,
            operation : this.operation,
            leftNum : this.leftNum
        };
        if(this.timer !== 0) {
            msg.timer = this.timer;
        }
        if(this.tingList.length !== 0) {
            msg.tingList = this.tingList;
        }
        if(this.gangList.length !== 0) {
            msg.gangList = this.gangList;
        }
        if(this.card !== 0) {
            msg.card = this.card;
        }
        if(this.tingResults.length !== 0) {
            msg.tingResults = this.tingResults;
        }
        if(this.grabCard !== 0) {
            msg.grabCard = this.grabCard;
        }
        return msg;
    }
}

module.exports = ZhuojiNotifyActiveMsg;
